//
//  DetailHeaderView.m
//  yuke
//
//  Created by Dejun Liu on 15/1/9.
//  Copyright (c) 2015年 juwan. All rights reserved.
//

#import "DetailHeaderView.h"
#define RightSpaceOfCamera 60.0f

@implementation DetailHeaderView

- (void)initialSetup
{
    [super initialSetup];
    self.camera = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.camera setImage:[UIImage imageNamed:@"camera"] forState:0];
    [self.camera setTitle:@"1212" forState:UIControlStateNormal];
    self.camera.titleLabel.font = [UIFont systemFontOfSize:12.0f];
    self.camera.titleLabel.adjustsFontSizeToFitWidth = YES;
    [self.camera setTitleColor:YKCOLOR_MAIN_GRAY_PRESS forState:UIControlStateHighlighted];
    self.camera.frame = CGRectMake(self.width - RightSpaceOfCamera, self.height - 22, 46, 20);
    self.camera.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
    [self.camera addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.camera];
    
    self.camera.hidden = YES;
    
//    self.countLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width-RightSpaceOfCamera+20, self.height - 22, 26, 20)];
//    self.countLabel.font = [UIFont systemFontOfSize:12];
//    self.countLabel.text = @"123";
//    self.countLabel.adjustsFontSizeToFitWidth = YES;
//    self.countLabel.textColor = [UIColor colorWithHex:0xcacaca];
//    [self addSubview:self.countLabel];
}

+ (id)headerViewWithCGSize:(CGSize)headerSize
{
    DetailHeaderView *headerView = [[self alloc] initWithFrame:CGRectMake(0, 0, headerSize.width, headerSize.height)];
    [headerView initialSetup];
    return headerView;
}

- (void)btnClickBlock:(BTNBLOCK)block
{
    _btnBlock = block;
}

- (void)btnClick
{
    _btnBlock(@"");
}

@end
